
use anyhow::Result;
use std::collections::HashMap;

use std::borrow::Borrow;
use serde::{Deserialize, Serialize};
use serde_json::{Value, to_value};

use crate::node::types::TaskType;
use crate::node::{JsonRpcError, JsonRpcRequest, JsonRpcResponse};

use crate::state::State;

#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct SectorStorageInfo {
    #[serde(rename = "ID")]
    pub id: String,
    #[serde(rename = "URLs")]
    pub urls: Vec<String>,
    pub weight: u64,
    pub can_seal: bool,
    pub can_store: bool,
}

// pub async fn find_sector_storage_info(
//     state: &State,
//     key: &str,
//     id: &str,
// ) -> Result<Option<SectorStorageInfo>> {
//     let mut p = vec![Value::from(id)];
//     let req = JsonRpcRequest::with_params("Filecoin.StorageInfo", p);
//
//     let rsp = state
//         .sealer_request::<Value, SectorStorageInfo>(key, req)
//         .await?;
//     Ok(rsp)
// }
